package com.huopaolan.yohuoshop.NetWork;

import com.huopaolan.yohuoshop.Bean.BaseEntity;
import com.huopaolan.yohuoshop.Bean.BrandEntity;
import com.huopaolan.yohuoshop.Bean.CategoryAllGoodsEntity;
import com.huopaolan.yohuoshop.Bean.CategoryGoodsEntity;
import com.huopaolan.yohuoshop.Bean.CommodityDetailsEntity;
import com.huopaolan.yohuoshop.Bean.ShoppingTrolleyEntity;
import com.huopaolan.yohuoshop.Bean.ShowEntity;
import com.huopaolan.yohuoshop.Bean.StrollCommunityEntity;
import com.huopaolan.yohuoshop.Bean.HomeBannerEntity;
import com.huopaolan.yohuoshop.Bean.HomeGoodsEntity;
import com.huopaolan.yohuoshop.Bean.HomeMenuEntity;
import com.huopaolan.yohuoshop.Bean.HomeRecommendEntity;
import com.huopaolan.yohuoshop.Bean.ShoesEntity;
import com.huopaolan.yohuoshop.Bean.CommunityEntity;
import com.huopaolan.yohuoshop.Bean.UserEntity;
import com.huopaolan.yohuoshop.Bean.UserMessageEntity;
import com.huopaolan.yohuoshop.Bean.UserRegisterEntity;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;

public interface API {
    public final static String BaseUrl = "http://169.254.197.176/yoho/";

    /**
     * 1.首页菜单接口
     * http://169.254.134.250/yoho/home_menu.php
     */
    @GET("home_menu.php")
    Observable<HomeMenuEntity> home_menu_request();

    /**
     * 2.首页广告接口
     */
    @GET("Home_banner.php")
    Observable<HomeBannerEntity> home_banner_request();

    /**
     * 3.首页推荐接口
     */
    @FormUrlEncoded
    @POST("home_recommend.php")
    Observable<HomeRecommendEntity> home_recommend_request(@Field("request") String request);

    /**
     * 4.首页列表接口
     */
    @FormUrlEncoded
    @POST("home_goods.php")
    Observable<HomeGoodsEntity> home_goods_request(@Field("request") String request);

    /**
     * 5.品类接口
     */
    @FormUrlEncoded
    @POST("category_all.php")
    Observable<CategoryAllGoodsEntity> classify_category_all_request(@Field("request") String request);

    /**
     * 6.品类商品接口
     */
    @FormUrlEncoded
    @POST("category_goods.php")
    Observable<CategoryGoodsEntity> classify_goods_request(@Field("request") String request);

    /***
     * 7.品牌列表接口
     */
    @FormUrlEncoded
    @POST("Brand_list.php")
    Observable<BrandEntity> brand_goods_request(@Field("request") String request);

    /**
     * 8.球鞋交易接口
     */
    @FormUrlEncoded
    @POST("shoes_list.php")
    Observable<ShoesEntity> shoes_goods_request(@Field("request") String request);

    /**
     * 9.逛分类接口
     */
    @FormUrlEncoded
    @POST("see_category.php")
    Observable<ShoesEntity> see_category_request(@Field("request") String request);

    /**
     * 10.逛列表接口
     */
    @FormUrlEncoded
    @POST("see_list.php")
    Observable<CommunityEntity> see_list_request(@Field("request") String request);

    /**
     * 11.社区列表接口
     */
    @FormUrlEncoded
    @POST("community.php")
    Observable<StrollCommunityEntity> community_list_request(@Field("request") String request);

    /**
     * 12.Show列表接口
     */
    @FormUrlEncoded
    @POST("show.php")
    Observable<ShowEntity> show_list_request(@Field("request") String request);

    /**
     * 13.用户登录接口
     */
    @FormUrlEncoded
    @POST("login.php")
    Observable<UserEntity> login_user_request(@Field("request") String request);
    /**
     * 14.用户注册接口
     */
    @FormUrlEncoded
    @POST("register.php")
    Observable<UserRegisterEntity> register_user_request(@Field("request") String request);
    /**
     * 15.商品详情接口
     */
    @FormUrlEncoded
    @POST("goods_values.php")
    Observable<CommodityDetailsEntity> goods_values_request(@Field("request") String request);
    /**
     * 16.商品尺寸接口 sel_goods_values.php request={"goodsid":"1"}
     * */
    /**
     * 17.加入购物车接口 add_car.php request={"userid":"1","goodsid":"1","shopname":"hehe","shopcolor":"1","shopsize":"1","shopnum":"1","shopprice":"1"}
     * */
    @FormUrlEncoded
    @POST("add_car.php")
    Observable<BaseEntity> add_car_request(@Field("request") String request);
    /**
     * 18.购物车列表接口 car_list.php request={"userid":"1"}
     */
    @FormUrlEncoded
    @POST("car_list.php")
    Observable<ShoppingTrolleyEntity> car_list_request(@Field("request") String request);
    /**
     * 19.订单接口 create_order.php request={"userid":"1"}
     * */
    /**
     * 20.添加收货地址 add_address.php request={"user_id":"1","user_name":"wzh","phone":"12345678","address_area":"北京市","address_detail":"八维","address_tag":"家"}
     * */
    /**
     * 21.收货地址列表 address_list.php request={"user_id":"1"}
     * */
    /**
     * 22.优惠券列表  coupon_list.php request={"user_id":"1"}
     * */
    /**
     * 23.足迹列表 footprint.php request={“user_id”:”1”}
     * */
    /**
     * 24.删除收货地址接口 del_address.php request={“address_id”:”1”}
     * */
    /**
     * 25.软件升级接口  upgrade.php request={“version_code”:”2”}
     * */
    /**
     * 26.查询用户信息接口 sel_user.php request={"userid":"1"}
     */
    @FormUrlEncoded
    @POST("sel_user.php")
    Observable<UserMessageEntity> sel_user_request(@Field("request") String request);
    /**
     * 27.上传用户头像接口 upload_head.php uploadedfile:图片
     * userid:用户id
     * */
    @Multipart
    @POST("upload_head.php")
    Observable<BaseEntity> upload_head_request(@Part List<MultipartBody.Part> list);
    /**
     * 28.更改用户信息接口 update_user.php request={"userid":"27","nickname":"王忠华4年工作经验","usersex":"男","userbirthday":"19930127","userheight":"170cm","userweight":"170kg"}
     */
    @FormUrlEncoded
    @POST("update_user.php")
    Observable<BaseEntity> update_user_request(@Field("request") String request);
    /**
     * 29.收藏商品接口 collection.php request={"userid":"1","goodsid":"1"}
     * */
    @FormUrlEncoded
    @POST("collection.php")
    Observable<BaseEntity> collection_request(@Field("request") String request);
    /**
     * 30.取消收藏接口 uncollection.php request={"userid":"1","goodsid":"1"}
     * */
    @FormUrlEncoded
    @POST("uncollection.php")
    Observable<BaseEntity> uncollection_request(@Field("request") String request);
}